<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
  <head>
 <title>商品管理表</title>
    
	<meta http-equiv="pragma" content="艺博客，装点生活">
	<meta http-equiv="cache-control" content="艺博客为书画爱好者提供服务平台">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link href="manage/css/styleb.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="manage/js/jqueryb.js"></script>
 
<script type="text/javascript">

 
</script>


</head>


<body>
    <div class="rightinfo">  
    <div class="rightform">
    <form action="" method="post">
    查询的品牌名:&nbsp;&nbsp;<input type="text" name="pbrand" style="border:1px solid ;border-color:navy blue">
    查询的商品名:&nbsp;&nbsp;<input type="text" name="pname"style="border:1px solid ;border-color:navy blue">
    价格:&nbsp;&nbsp;<input type="text" name="lowmoney"style="border:1px solid ;border-color:navy blue">
       <input type="text" name="maxmoney"style="border:1px solid ;border-color:navy blue">
       <input type="submit" name="提交"style="border:1px solid ;border-color:navy blue">   
    </div>
    <br>
    <hr style="height:1px;border:none;border-top:1px dashed #0066CC;" />
    <table class="tablelist">
        <thead>
	 	    <tr >
			      <th style="width:30px"><input name="" type="checkbox" value="" checked="checked"/></th>
			      <th style="width:30px">id</th>
			      <th style="width:80px">商品名</th>
			      <th style="width:35px">作者</th>
			    
			      <th style="width:35px">价格</th>
			      <th style="width:35px">数量</th>
				  <th style="width:35px">商品图</th>
			
				  <th style="width:40px">类型</th>
				  <th style="width:40px">主题</th>
				  <th style="width:40px">适用场所</th>
				  <th style="width:60px">尺寸</th>
				  <th style="width:60px">上架时间</th>
				  <th style="width:60px">下架时间</th>
				  <th style="width:35px">出售</th>
				  <th style="width:35px">标记</th>
				  <th colspan="3" style="width:110px">对商品的操作</th>
	      </tr>
        </thead>
        <tbody>
        <c:forEach items="${pageProductMessage.list}" var="i"> 
        <tr>
        <td><input name="${i.p_id}" type="checkbox" value="${i.p_id }" /></td>
        <td>${i. p_id}</td>
        <td>${i.p_name }</td>
        <td>${i. p_author}</td>
		
        <td>${i.p_price }</td>
        <td>${i.p_count }</td>
       	<td><img src="${i. p_image}" width="40" height="40"></td> 
        <td>${i.art_type }</td>
        <td>${i. t_type}</td>
        <td>${i. occations}</td>
        <td>${i.p_size }</td>
     	<td>${i.shelf_time }</td>
        <td>${i.down_time }</td>
        <td>${i.p_sale }</td>
        <td>${i.p_flag }</td>       
        <td><a href="hProdouctsearch.jsp?hProdouctsearchID=${i.p_id}" class="tablelink">查看</a> </td>
       <!--soldOutID 下架商品的id -->

        <td><a href="hproductdele.do?soldOutID=${i.p_id}" onclick="return soldOutID()" class="tablelink">上架</a></td>
      
        <td><a href="hproductdele.do?deleteProductID=${i.p_id}" onclick="deleteProductID()" class="tablelink">删除</a></td>
        </tr> 
        </c:forEach>
        </tbody>
         </table>
	<script type="text/javascript">
	    function  soldOutID(){
	         if(confirm("您要确认上架吗？"))
	         return true;
	         else
	         return false;
	    }
	    
	     function  deleteProductID(){
	         if(confirm("您确定要把下架的商品彻底删除吗？"))
	         return true;
	         else
	         return false;
	    }
	      
	</script>
   


    <div class="pagin">
    	<div class="message">共<i class="blue">${pageProductMessage.totalRecord}</i>条记录，当前显示第&nbsp;<i class="blue">${pageProductMessage.pageNun}&nbsp;</i>页</div>
        <ul class="paginList">
        <!-- 如果当前有为第一页时，就没有上一页的超链接显示 -->
        <c:if test="${pageProductMessage.pageNun != 1 }">
            <li class="paginItem"><a href=" ${pageContext.request.contextPath}/hproductdele.do?pageNun=${pageProductMessage.pageNun - 1}"><span class="pagepre"> < </span></a></li>
        </c:if>
        
        <c:forEach begin="${pageProductMessage.start }" end="${pageProductMessage.end }"  step="1" var="i" >
      
           <%--   <c:if test="${pageProductMessage.pageNu == i}"> --%>
             <li class="paginItem"><a href=" ${pageContext.request.contextPath}/hproductdele.do?pageNun=${i}">${i}</a></li>
            <%--  </c:if> --%>
        </c:forEach>
        
         <c:if test="${pageProductMessage.pageNun !=  pageProductMessage.totalPage}">
             <li class="paginItem"><a href=" ${pageContext.request.contextPath}/hproductdele.do?pageNun=${pageProductMessage.pageNun+1} "><span class="pagenxt">></span></a></li>
        </c:if>
        </ul>
    </div>
    </div>
    </form>
    </div>
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>
</body>
</html>